cmake_minimum_required(VERSION 3.1)
project(islogkbdhooklib)

if (MSVC)
	SET(VERSION_PRODUCTNAME_VALUE "islogkbdhooklib")
	add_definitions(-DVERSION_PRODUCTNAME_VALUE="${VERSION_PRODUCTNAME_VALUE}")
endif()

file(GLOB SRCS *.cpp)

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
    set(TARGET_LIBRARY_NAME islogkbdhooklib64)
else()
    set(TARGET_LIBRARY_NAME islogkbdhooklib32)
endif()

add_library(${TARGET_LIBRARY_NAME}
	SHARED	
	${SRCS}
	${LLA_RESOURCE_RC})
target_compile_definitions(${TARGET_LIBRARY_NAME} PRIVATE "ISLOGKBDHOOKLIB_EXPORTS=1")

SET_TARGET_PROPERTIES(${TARGET_LIBRARY_NAME} PROPERTIES VERSION ${LIBLOGICALACCESS_VERSION_STRING})
target_link_libraries(${TARGET_LIBRARY_NAME}
	logicalaccess)

install ( TARGETS ${TARGET_LIBRARY_NAME} RUNTIME DESTINATION bin/${LIB_SUFFIX} ARCHIVE DESTINATION lib/${LIB_SUFFIX} LIBRARY DESTINATION lib/${LIB_SUFFIX} )
if (MSVC)
	install(FILES $<TARGET_PDB_FILE:${TARGET_LIBRARY_NAME}> DESTINATION pdb/${LIB_SUFFIX} OPTIONAL)
endif()
